home *** CD-ROM | disk | FTP | other *** search
- class classes.shots.DroidBFire
- {
- var x;
- var y;
- var id;
- var dir;
- var clip;
- var axis;
- var xMov = 0;
- var yMov = 0;
- var Name = "droidBFire";
- var power = 10;
- var yank = false;
- function DroidBFire(px, py, pDir, pid)
- {
- this.x = px;
- this.y = py;
- this.id = pid;
- this.dir = pDir;
- _root.d = _root.d + 1;
- this.clip = _root.attachMovie("droidBFire","droidBFire" + this.id + "Clip",_root.d);
- this.clip._x = this.x;
- this.clip._y = this.y;
- this.clip.id = this.id;
- if(this.dir == "U")
- {
- this.axis = "y";
- this.yMov = -11;
- this.xMov = 0;
- this.y += 11;
- }
- else if(this.dir == "D")
- {
- this.axis = "y";
- this.yMov = 11;
- this.xMov = 0;
- this.y -= 11;
- }
- else if(this.dir == "R")
- {
- this.axis = "x";
- this.yMov = 0;
- this.xMov = 11;
- this.x -= 11;
- }
- else
- {
- this.axis = "x";
- this.yMov = 0;
- this.xMov = -11;
- this.x += 11;
- }
- this.xMov *= _root.dif.speed;
- this.yMov *= _root.dif.speed;
- this.clip.gotoAndStop(this.dir);
- this.xMov *= _root.randRange2(0.9,1.1);
- this.yMov *= _root.randRange2(0.9,1.1);
- }
- function hit()
- {
- this.yank = true;
- }
- function main()
- {
- this[this.axis + "Mov"] *= 1.02;
- if(this.clip.hitTest(_root[_root.char + "Clip"]))
- {
- _root[_root.char].hit(this.xMov,this.yMov,100,this.power);
- this.yank = true;
- }
- if(this.x > 1050 || this.x < -50 || this.y > 650 || this.y < -50)
- {
- this.yank = true;
- }
- if(this.yank)
- {
- _root.removeEnemyShot("droidBFire" + this.id);
- this.yank = false;
- }
- this.x += this.xMov;
- this.y += this.yMov;
- this.clip._x = this.x;
- this.clip._y = this.y;
- }
- }
-